﻿using UnityEngine;
using System.Collections;

public class ShopPanel : BasePanel {

	private CanvasGroup canvasGroup;

	void Start(){		
		canvasGroup = GetComponent<CanvasGroup> ();
	}

	public void OnClosePanel(){

		UIManager.Instance.popPanel ();
	}

	public override void OnExit ()
	{
		canvasGroup.alpha = 0;
		canvasGroup.blocksRaycasts = false;
	}

	public override void OnEnter ()
	{
		if (canvasGroup == null) {
			canvasGroup = GetComponent<CanvasGroup> ();
		}
		canvasGroup.alpha = 1;
		canvasGroup.blocksRaycasts = true;
	}

	public override void OnPause ()
	{
		canvasGroup.blocksRaycasts = false;
	}   



	public override void OnResume ()
	{
		canvasGroup.blocksRaycasts = true;
	}
}
